import { defineStore } from "pinia";
import { ref } from "vue";

export const userStore = defineStore(
  "userStore",
  () => {
    const userToken = ref();

    const setuserStore = val => {
      userToken.value = val;
      // console.log("token" + userToken.value);
    };

    // 清理会员信息，退出时使用
    const clearuserStore = () => {
      chatRoom.value = undefined;
    };

    return { setuserStore, clearuserStore, userToken };
  },
  {
    persist: true,
  }
);
